import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'
import axios from "axios";
import qs from "qs"

import { library } from '@fortawesome/fontawesome-svg-core'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
import { faMapMarkerAlt, faSortDown, faSearch, faHome } from '@fortawesome/free-solid-svg-icons'
import { faCompass, faFileAlt, faUser } from '@fortawesome/free-regular-svg-icons'




library.add(faMapMarkerAlt, faSortDown, faSearch, faHome, faCompass, faFileAlt, faUser)

/*router.beforeEach(function(to,from,next){
    let user = sessionStorage.getItem('user');
    //除了登录、注册、首页、商家列表、商家信息之外，都需要判断是否登录
    if(!
        (to.path==='/'||to.path==='/index'||to.path==='/businessList'||to.path==='/businessInfo'||to.path==='/login'||to.path==='/register')){
    if(user==null){
        router.push('/login');
        location.reload();
    }
}
next();
});*/

const app = createApp(App)

app.use(createPinia())
app.use(router)

app.provide("$axios",axios)
app.provide("$qs",qs)
app.component('font-awesome-icon', FontAwesomeIcon)
app.mount('#app')


